//
//  QKSearchBar.m
//  QuKeClient
//
//  Created by delicious on 2017/12/15.
//  Copyright © 2017年 delicious. All rights reserved.
//

#import "QKSearchBar.h"

@implementation QKSearchBar
- (instancetype)init
{
    self = [super init];
    if (self) {
        UITextField *textfield = [self valueForKey:@"_searchField"];
        [textfield setValue:hexCOLOR(@"#878787") forKeyPath:@"_placeholderLabel.textColor"];
        [textfield setValue:[UIFont boldSystemFontOfSize:kFitW(16)]forKeyPath:@"_placeholderLabel.font"];
        self.barTintColor = hexCOLOR(@"#f2f2f2");
//        searchBar.barTintColor =
    }
    return self;
}

-(void) layoutSubviews{
    [super layoutSubviews];
    
    UITextField *searchTextField = [self valueForKey:@"_searchField"];
    CGSize size = self.frame.size;
    searchTextField.height =size.height-kFitH(20);
    searchTextField.centerY = size.height/2;
}
    
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
